﻿@using SimpleSchedule.Models.Configs
@model Schedule

@{
    Config c = ViewData["config"] as Config ?? throw new Exception("找不到配置");
}

<h1>新建安排</h1>
<form asp-action="Add" method="post">
    <table class="table">
        <tr>
            <td>
                会员卡号
            </td>
            <td>
                <input asp-for="Name" type="text" required/>
            </td>
        </tr>
        <tr>
            <td>手机号</td>
            <td>
                <input asp-for="Tel" type="text" />
            </td>
        </tr>
        <tr>
            <td>创建日期</td>
            <td>
                <input asp-for="Created"/>
            </td>
        </tr>
        <tr>
            <td>到期日期</td>
            <td>
                <input asp-for="Target"/>
            </td>
        </tr>
        <tr>
            <td>
                多少天后（覆盖到期日期）（可不填）
            </td>
            <td>
                <input name="days" value="" type="number"/>
            </td>
        </tr>
        <tr>
            <td>
                产品品牌
            </td>
            <td>
                <select name="brand">
                    @foreach(var b in c.QuickRemark!.BrandList)
                    {
                        <option value="@b">@b</option>
                    }
                </select>
            </td>
        </tr>
        <tr>
            <td>
                产品规格
            </td>
            <td>
                <select name="spec">
                    @foreach (var s in c.QuickRemark!.SpecList)
                    {
                        <option value="@s">@s</option>
                    }
                </select>
            </td>
        </tr>
        <tr>
            <td>
                操作人员
            </td>
            <td>
                <select name="staff">
                    @foreach (var s in c.QuickRemark!.StaffList)
                    {
                        <option value="@s">@s</option>
                    }
                </select>
            </td>
        </tr>
        <tr>
            <td>

            </td>
            <td>
                <input type="submit" value="创建"/>
            </td>
        </tr>
    </table>
</form>